import request from '@/libs/request'

/**
 * 系别列表
 * @returns
 */
export const deptList = () => {
  return request({
    url: `/dept/list`,
    method: 'get'
  })
}

/**
 * 系别详情
 * @returns
 */
export const deptInfo = data => {
  return request({
    url: `/dept/${data.dept_id}/info`,
    method: 'get'
  })
}

/**
 * 添加系别
 * @returns
 */
export const deptAdd = data => {
  return request({
    url: `/dept/add`,
    method: 'post',
    data: data
  })
}

/**
 * 修改系别
 * @returns
 */
export const deptEdit = data => {
  return request({
    url: `/dept/${data.dept_id}/info`,
    method: 'put',
    data
  })
}

/**
 * 删除系别
 * @returns
 */
export const deptDelete = data => {
  return request({
    url: `/dept/${data.dept_id}/info`,
    method: 'delete'
  })
}
